<template>
    <div>
        <el-row style="padding: 10px">
            <!-- <el-col :span="23">
                <el-tabs v-model="activeName1">
                    <el-tab-pane
                        label="检验报告"
                        name="first"
                    > -->
            <el-button size="mini" @click="reGet" style="float: right"
                >重新获取
            </el-button>
            <el-tabs
                v-model="reportActiveName"
                type="card"
                @tab-click="reportActiveClick"
                style="margin-top: 25px"
            >
                <el-tab-pane label="特殊指标" name="tezheng">
                    <el-row>
                        <el-col :span="24">
                            <el-form :inline="true" style="float: right">
                                <el-form-item label="选择检验项:">
                                    <el-select
                                        v-model="selectionItemsValue"
                                        placeholder="请选择"
                                        size="mini"
                                        multiple
                                        @change="SelectionItemschange"
                                    >
                                        <el-option
                                            v-for="item in SelectionItemsData"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value"
                                        >
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-form>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-table
                            style="width: 100%"
                            :data="ReportData"
                            v-loading="inspectionloading"
                            :header-cell-style="{
                                'background-color': '#E6E9EF',
                                color: '#777C7C',
                                'font-weight': '400',
                                'border-right': '1px solid #ffffff',
                            }"
                            :cell-style="cellClass"
                            stripe
                            border
                        >
                            <el-table-column
                                v-for="config in inspectionCloumeData"
                                :key="config.prop"
                                :prop="config.prop"
                                :label="config.label"
                                :width="config.width"
                                align="center"
                                sortable
                            >
                            </el-table-column>
                            <el-table-column
                                label="操作"
                                width="100"
                                fixed
                                align="center"
                            >
                                <template slot-scope="scope">
                                    <el-button
                                        @click="
                                            qsPIC(
                                                scope.row.eventName,
                                                scope.row.unit
                                            )
                                        "
                                        type="text"
                                        size="mini"
                                        >趋势图
                                    </el-button>
                                </template>
                            </el-table-column>
                            <el-table-column
                                label="异常提示"
                                width="80"
                                fixed
                                align="center"
                            >
                                <template slot-scope="scope">
                                    <el-popover trigger="hover" placement="top">
                                        <p v-if="scope.row.ycts === 'null'">
                                            正常
                                        </p>
                                        <p v-if="scope.row.ycts === 'L'">
                                            偏低
                                        </p>
                                        <p v-if="scope.row.ycts === 'H'">
                                            偏高
                                        </p>
                                        <div
                                            slot="reference"
                                            class="name-wrapper"
                                        >
                                            <i
                                                class="el-icon-circle-check"
                                                style="color: #67c23a"
                                                v-if="scope.row.ycts === 'null'"
                                            ></i>
                                            <i
                                                class="el-icon-top"
                                                style="color: red"
                                                v-if="scope.row.ycts === 'H'"
                                            ></i>
                                            <i
                                                class="el-icon-bottom"
                                                style="color: red"
                                                v-if="scope.row.ycts === 'L'"
                                            ></i>
                                        </div>
                                    </el-popover>
                                </template>
                            </el-table-column>
                        </el-table>

                        <el-row style="margin-top: 10px" align="right">
                            <el-pagination
                                :page-sizes="[5, 15, 20]"
                                style="text-align: center; margin-top: 12px"
                                @current-change="inspectionCurrentchange"
                                @size-change="inspectionPagesizeChange"
                                :current-page="inspectionPageCurrent"
                                :page-size="inspectionPageSize"
                                layout="sizes, prev, pager, next, total"
                                :total="inspectionTotalPage"
                            >
                            </el-pagination>
                        </el-row>
                    </el-row>
                </el-tab-pane>
                <el-tab-pane label="异常指标" name="yichang">
                    <el-row>
                        <el-col :span="24">
                            <el-form :inline="true" style="float: right">
                                <el-form-item label="选择检验项:">
                                    <el-select
                                        v-model="selectionItemsValue"
                                        placeholder="请选择"
                                        size="mini"
                                        multiple
                                        @change="abnormalChange"
                                    >
                                        <el-option
                                            v-for="item in abnormalSelectionItemsData"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value"
                                        >
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-form>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-table
                            style="width: 100%"
                            :data="ReportData"
                            v-loading="inspectionloading"
                            :header-cell-style="{
                                'background-color': '#E6E9EF',
                                color: '#777C7C',
                                'font-weight': '400',
                                'border-right': '1px solid #ffffff',
                            }"
                            :cell-style="cellClass"
                            stripe
                            border
                        >
                            <el-table-column
                                v-for="config in inspectionCloumeData"
                                :key="config.prop"
                                :prop="config.prop"
                                :label="config.label"
                                :width="config.width"
                                align="center"
                                sortable
                            >
                            </el-table-column>
                            <el-table-column
                                label="操作"
                                width="100"
                                align="center"
                                fixed
                            >
                                <template slot-scope="scope">
                                    <el-button
                                        @click="
                                            qsPIC(
                                                scope.row.eventName,
                                                scope.row.unit
                                            )
                                        "
                                        type="text"
                                        size="mini"
                                        >趋势图
                                    </el-button>
                                </template>
                            </el-table-column>
                            <el-table-column
                                label="异常提示"
                                width="80"
                                fixed
                                align="center"
                            >
                                <template slot-scope="scope">
                                    <el-popover trigger="hover" placement="top">
                                        <p v-if="scope.row.ycts === 'null'">
                                            正常
                                        </p>
                                        <p v-if="scope.row.ycts === 'L'">
                                            偏低
                                        </p>
                                        <p v-if="scope.row.ycts === 'H'">
                                            偏高
                                        </p>
                                        <div
                                            slot="reference"
                                            class="name-wrapper"
                                        >
                                            <i
                                                class="el-icon-circle-check"
                                                style="color: #67c23a"
                                                v-if="scope.row.ycts === 'null'"
                                            ></i>
                                            <i
                                                class="el-icon-top"
                                                style="color: red"
                                                v-if="scope.row.ycts === 'H'"
                                            ></i>
                                            <i
                                                class="el-icon-bottom"
                                                style="color: red"
                                                v-if="scope.row.ycts === 'L'"
                                            ></i>
                                        </div>
                                    </el-popover>
                                </template>
                            </el-table-column>
                        </el-table>

                        <el-row style="margin-top: 10px" align="right">
                            <el-pagination
                                :page-sizes="[5, 15, 20]"
                                style="text-align: center; margin-top: 12px"
                                @current-change="abnormalCurrentPageChange"
                                @size-change="abnormalPageSizeChange"
                                :current-page="abnormalPageCurrent"
                                :page-size="abnormalPageSize"
                                layout="sizes, prev, pager, next, total"
                                :total="inspectionTotalPage"
                            >
                            </el-pagination>
                        </el-row>
                    </el-row>
                </el-tab-pane>
                <el-tab-pane label="全部指标" name="allIndex">
                    <el-row>
                        <el-col :span="24">
                            <el-form :inline="true" style="float: right">
                                <el-form-item label="选择检验项:">
                                    <el-select
                                        v-model="allSelectionItemsValue"
                                        placeholder="请选择"
                                        size="mini"
                                        multiple
                                        @change="allChange"
                                    >
                                        <el-option
                                            v-for="item in SelectionItemsData"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value"
                                        >
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-form>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-table
                            style="width: 100%"
                            :data="ReportData"
                            v-loading="inspectionloading"
                            :header-cell-style="{
                                'background-color': '#E6E9EF',
                                color: '#777C7C',
                                'font-weight': '400',
                                'border-right': '1px solid #ffffff',
                            }"
                            :cell-style="cellClass"
                            stripe
                            border
                        >
                            <el-table-column
                                v-for="config in inspectionCloumeData"
                                :key="config.prop"
                                :prop="config.prop"
                                :label="config.label"
                                :width="config.width"
                                align="center"
                                sortable
                            >
                            </el-table-column>
                            <el-table-column
                                label="操作"
                                width="100"
                                fixed
                                align="center"
                            >
                                <template slot-scope="scope">
                                    <el-button
                                        @click="
                                            qsPIC(
                                                scope.row.eventName,
                                                scope.row.unit
                                            )
                                        "
                                        type="text"
                                        size="mini"
                                        >趋势图
                                    </el-button>
                                </template>
                            </el-table-column>
                            <el-table-column
                                label="异常提示"
                                width="80"
                                fixed
                                align="center"
                            >
                                <template slot-scope="scope">
                                    <el-popover trigger="hover" placement="top">
                                        <p v-if="scope.row.ycts === 'null'">
                                            正常
                                        </p>
                                        <p v-if="scope.row.ycts === 'L'">
                                            偏低
                                        </p>
                                        <p v-if="scope.row.ycts === 'H'">
                                            偏高
                                        </p>
                                        <div
                                            slot="reference"
                                            class="name-wrapper"
                                        >
                                            <i
                                                class="el-icon-circle-check"
                                                style="color: #67c23a"
                                                v-if="scope.row.ycts === 'null'"
                                            ></i>
                                            <i
                                                class="el-icon-top"
                                                style="color: red"
                                                v-if="scope.row.ycts === 'H'"
                                            ></i>
                                            <i
                                                class="el-icon-bottom"
                                                style="color: red"
                                                v-if="scope.row.ycts === 'L'"
                                            ></i>
                                        </div>
                                    </el-popover>
                                </template>
                            </el-table-column>
                        </el-table>

                        <el-row style="margin-top: 10px" align="right">
                            <el-pagination
                                :page-sizes="[5, 15, 20]"
                                style="text-align: center; margin-top: 12px"
                                @current-change="AllinspectionCurrentchange"
                                @size-change="AllinspectionPagesizeChange"
                                :current-page="allPageCurrent"
                                :page-size="allPageSize"
                                layout="sizes, prev, pager, next, total"
                                :total="allTotalPage"
                            >
                            </el-pagination>
                        </el-row>
                    </el-row>
                </el-tab-pane>
            </el-tabs>
            <!-- </el-tab-pane>
                    <el-tab-pane
                        label="电子病历"
                        name="second"
                    >暂无数据</el-tab-pane>
                    <el-tab-pane
                        label="检查"
                        name="third"
                    >暂无数据</el-tab-pane>
                    <el-tab-pane
                        label="胃镜"
                        name="fourth"
                        style="padding:0 10px;"
                    >
                        <span slot="label">
                            胃镜
                            <el-badge
                                v-if="gastroscopEeditableTabs.length > 0"
                                :value="gastroscopEeditableTabs.length"
                                class="tab-content-badge"
                            ></el-badge>
                        </span>
                        <el-tabs
                            v-model="gastroscopeTabsValue"
                            type="card"
                            v-if="gastroscopEeditableTabs.length>0"
                        >
                            <el-tab-pane
                                :key="index"
                                v-for="(item, index) in gastroscopEeditableTabs"
                                :label="item.title"
                                :name="item.name"
                            >
                                <el-card
                                    :body-style="{ padding: '0px' }"
                                    shadow="hover"
                                    class="box-card;weight:90%"
                                >
                                    <el-row style="padding-top:10px;margin-left: 10px;">
                                        <span class="font-size:20px">检查所见:</span>
                                        <p style="margin-top: 10px;
                                        margin-left: 40px;font-size:15px">
                                            {{item.content.examFind}}
                                        </p>
                                        <span class="font-size:20px">检查记录:</span>
                                        <p style="margin-top: 10px;
                                        margin-left: 40px;font-size:15px">
                                            {{item.content.examRecord}}</p>
                                    </el-row>
                                    <el-row>
                                        <p style="font-size:10px;
                                        float:right;padding-right:30px">
                                            检查医生姓名:{{item.content.examDocName}}
                                            <br>检查日期:{{item.title}}
                                        </p>
                                    </el-row>
                                </el-card>
                            </el-tab-pane>
                        </el-tabs>
                        <div v-else>暂无数据</div>
                    </el-tab-pane>
                </el-tabs>
            </el-col>
            <el-col :span="1">
                <el-button
                    size="mini"
                    type="primary"
                    :icon="ifShowMain ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
                    @click="changeShowMain"
                    circle
                ></el-button>
            </el-col> -->
        </el-row>
    </div>
</template>

<script>
import _ from 'lodash';
import diagnosisDefaultBase from '@templates/diagnosisDefault';
import moment from 'moment';

const diagnosisDefault = _.clone(diagnosisDefaultBase);

export default {
    name: 'OpinionBottom',
    props: {
        diagnosis: {
            type: Object,
            default: diagnosisDefault,
        },
    },
    data() {
        return {
            ReportData: [],
            selectionItemsvalue: [],
            selectionItemsFilter: {},
            abnormalFilter: '',
            allFilter: {},
            inspectionFilter: {},
            activeName1: 'first',
            reportActiveName: 'yichang',
            inspectionloading: false,
            // 院内诊断表格数据
            inspectionCloumeData: [
                {
                    prop: 'medicalRecordNumber',
                    label: '病历号',
                    width: '150',
                },
                {
                    prop: 'bgdhName',
                    label: '报告单号',
                },
                {
                    prop: 'consequenceTime',
                    label: '报告时间',
                },
                {
                    prop: 'eventName',
                    label: '检验指标',
                },
                {
                    prop: 'eventShort',
                    label: '简称',
                },
                {
                    prop: 'consequence',
                    label: '检验结果',
                },
                {
                    prop: 'unit',
                    label: '单位',
                },
                {
                    prop: 'reference',
                    label: '参考值',
                },
                {
                    prop: 'ycts',
                    label: '异常提示代码',
                },
                {
                    prop: 'outHospitalNo',
                    label: '住院号',
                },
                {
                    prop: 'applyForTime',
                    label: '采样时间',
                },
            ],
            inspectionPageCurrent: 1,
            inspectionPageSize: 15,
            inspectionTotalPage: 0,
            allSelectionItemsValue: [],
            SelectionItemsData: [],
            abnormalSelectionItemsData: [],
            abnormalPageCurrent: 1,
            abnormalPageSize: 15,
            abnormalTotalPage: 0,
            allPageCurrent: 1,
            allPageSize: 15,
            allTotalPage: 0,
            gastroscopeTabsValue: '1',
            gastroscopEeditableTabs: [],
            // 界面上面和下面是否展示（默认展示上面）
            ifShowMain: true,
            // 趋势图弹窗
            PICdialogVisible: false,
            tabStatusNumber: 0,
            ExceptionWarning : 'L,H',
        };
    },
    mounted() {
        // this.inspectionReportData(
        //     this.diagnosis.pathologyId,
        //     this.inspectionPageCurrent,
        //     this.inspectionPageSize,
        //     this.inspectionFilter,
        //     this.tabStatusNumber
        // );
        this.tabStatusNumber = 1;
        this.AbnormalIndicatorFilter = { ycts: this.ExceptionWarning };
        this.inspectionReportData(
            this.diagnosis.pathologyId,
            this.abnormalPageCurrent,
            this.abnormalPageSize,
            this.AbnormalIndicatorFilter,
            this.tabStatusNumber
        );

        // this.getGastroscopyData();
    },
    methods: {
        reGet() {
            this.$confirm('此操作将重新获取数据, 是否继续?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning',
            })
                .then(() => {
                    const pathologyId = sessionStorage.getItem('pathologyId');
                    this.$axios({
                        method: 'GET',
                        url: `/PROXY-Remote/inspectionInformation/againCreateAsyncTask/forInspectionInformationOfCancerHospital/by/${pathologyId}`,
                    })
                        .then((res) => {
                            if (res.data.code === 200) {
                                this.$message.info(
                                    '正在获取数据中，请稍后......'
                                );
                            }
                        })
                        .catch((error) => {
                            this.$message.error(error.message);
                        });
                })
                .catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消',
                    });
                });
        },
        // 下方相关方法=============================================================
        // 点击触发检验报告tab 的事件
        reportActiveClick(tab) {
            if (tab.label === '特殊指标') {
                this.tabStatusNumber = 0;
                this.selectionItemsValue = [];
                this.selectionItemsFilter = {};
                this.inspectionReportData(
                    this.diagnosis.pathologyId,
                    this.inspectionPageCurrent,
                    this.inspectionPageSize,
                    this.selectionItemsFilter,
                    this.tabStatusNumber
                );
            }
            if (tab.label === '异常指标') {
                this.tabStatusNumber = 1;
                this.selectionItemsValue = [];
                this.AbnormalIndicatorFilter = { ycts: this.ExceptionWarning };
                this.inspectionReportData(
                    this.diagnosis.pathologyId,
                    this.abnormalPageCurrent,
                    this.abnormalPageSize,
                    this.AbnormalIndicatorFilter,
                    this.tabStatusNumber
                );
            }
            if (tab.label === '全部指标') {
                this.tabStatusNumber = 1;
                this.selectionItemsValue = [];
                this.allFilter = {};
                this.inspectionReportData(
                    this.diagnosis.pathologyId,
                    this.allPageCurrent,
                    this.inspectionPageSize,
                    this.allFilter,
                    this.tabStatusNumber
                );
            }
        },

        // 检验报告数据(异常指标和特征指标会调用此方法)
        async inspectionReportData(
            pathologyId,
            PageCurrent,
            PageSize,
            filter,
            specialIndicators
        ) {
            this.inspectionloading = true;
            if (pathologyId) {
                let url = `/PROXY-Remote/inspectionInformation/special-index?page=${PageCurrent}&pathologyId=${pathologyId}&size=${PageSize}&specialIndicators=${specialIndicators}`;
                const datas = [];
                const params = {};
                if (filter.ycts) {
                    params.ycts = encodeURIComponent(filter.ycts);
                }
                if (filter.eventNames) {
                    params.eventNames = encodeURIComponent(filter.eventNames);
                }
                Object.getOwnPropertyNames(params).forEach((key) => {
                    const value = params[key];
                    if (value) {
                        datas.push(`${key}=${value}`);
                    }
                });
                if (datas.length > 0) {
                    url = `${url}&${datas.join('&')}`;
                }

                console.log('get-inspectionReportData', url);
                await this.$axios({
                    // 详见 axios 请求配置项
                    method: 'GET',
                    url,
                }).then((res) => {
                    const result = res.data;
                    // 请求成功
                    if (res.data.code === 200) {
                        this.ReportData = result.data;
                        this.inspectionTotalPage = result.pageInfo.total;
                        this.allTotalPage = result.pageInfo.total;
                        // 字典数据异常指标获取 为了异常指标列表展示
                        this.ExceptionWarning = 'L,H';
                        let SelectionItemsData = [];
                        // 请求成功
                        if (result.eventName.length > 0) {
                            result.eventName.forEach((temp) => {
                                SelectionItemsData.push({
                                    label: temp.eventName,
                                    value: temp.eventName,
                                });
                            });
                            this.SelectionItemsData = SelectionItemsData;
                            this.abnormalSelectionItemsData =
                                SelectionItemsData;
                        }
                    }
                    if (res.data.code === 500) {
                        this.$message.info('无数据');
                    }
                });
                this.inspectionloading = false;
            }
        },
        // 特殊检验项目带条件搜索
        SelectionItemschange() {
            let eventNames = '';
            if (this.selectionItemsValue.length > 0) {
                this.SelectionItemsData.forEach((temp) => {
                    this.selectionItemsValue.forEach((item) => {
                        if (temp.value === item) {
                            eventNames += `${temp.label},`;
                        }
                    });
                });
                const filter = { eventNames };
                this.selectionItemsFilter = filter;
                console.log(this.inspectionFilter);
                this.inspectionReportData(
                    this.diagnosis.pathologyId,
                    this.inspectionPageCurrent,
                    this.inspectionPageSize,
                    filter,
                    this.tabStatusNumber
                );
            }
        },
        // 全部指标检验项目带条件搜索
        allChange() {
            let eventNames = '';
            if (this.allSelectionItemsValue.length > 0) {
                this.SelectionItemsData.forEach((temp) => {
                    this.allSelectionItemsValue.forEach((item) => {
                        if (temp.value === item) {
                            eventNames += `${temp.label},`;
                        }
                    });
                });
                const filter = { eventNames };
                this.allFilter = filter;
                this.inspectionReportData(
                    this.diagnosis.pathologyId,
                    this.inspectionPageCurrent,
                    this.inspectionPageSize,
                    filter,
                    this.tabStatusNumber
                );
            }
        },
        qsPIC(row, unit) {
            console.log('qsPIC-row', row);
            this.PICdialogVisible = true;
            this.$emit(
                'drawECharts',
                row,
                unit,
                this.PICdialogVisible,
                this.SelectionItemsData
            );
        },
        inspectionCurrentchange(val) {
            this.inspectionPageCurrent = val;
            this.inspectionReportData(
                this.diagnosis.pathologyId,
                this.inspectionPageCurrent,
                this.inspectionPageSize,
                this.selectionItemsFilter,
                this.tabStatusNumber
            );
            this.inspectionPageCurrent = 1;
        },
        inspectionPagesizeChange(val) {
            this.inspectionPageSize = val;
            this.inspectionPageCurrent = 1;
            this.inspectionReportData(
                this.diagnosis.pathologyId,
                this.inspectionPageCurrent,
                this.inspectionPageSize,
                this.selectionItemsFilter,
                this.tabStatusNumber
            );
        },
        // 异常检验项目带条件搜索
        abnormalChange() {
            let eventNames = '';
            if (this.selectionItemsValue.length > 0) {
                this.abnormalSelectionItemsData.forEach((temp) => {
                    this.selectionItemsValue.forEach((item) => {
                        if (temp.value === item) {
                            eventNames += `${temp.label},`;
                        }
                    });
                });
                const filter = { eventNames, ycts: this.ExceptionWarning };
                this.abnormalFilter = filter;
                this.inspectionReportData(
                    this.diagnosis.pathologyId,
                    this.inspectionPageCurrent,
                    this.inspectionPageSize,
                    filter,
                    this.tabStatusNumber
                );
            }
        },
        // 表头样式
        cellClass() {
            const baseStyle = {
                padding: '3px 0',
                'border-right': '1px solid #ffffff',
            };
            return baseStyle;
        },
        // 检验报告全部指标分页
        AllinspectionCurrentchange(val) {
            this.allPageCurrent = val;
            this.inspectionReportData(
                this.diagnosis.pathologyId,
                this.allPageCurrent,
                this.allPageSize,
                this.allFilter,
                this.tabStatusNumber
            );
            this.allPageCurrent = 1;
        },
        AllinspectionPagesizeChange(val) {
            this.allPageSize = val;
            this.allPageCurrent = 1;
            this.inspectionReportData(
                this.diagnosis.pathologyId,
                this.allPageCurrent,
                this.allPageSize,
                this.allFilter,
                this.tabStatusNumber
            );
        },
        // 异常指标分页
        abnormalCurrentPageChange(val) {
            this.abnormalPageCurrent = val;
            this.inspectionReportData(
                this.diagnosis.pathologyId,
                this.abnormalPageCurrent,
                this.abnormalPageSize,
                this.abnormalFilter !== ''
                    ? this.abnormalFilter
                    : this.AbnormalIndicatorFilter,
                this.tabStatusNumber
            );
            this.abnormalPageCurrent = 1;
        },
        abnormalPageSizeChange(val) {
            this.abnormalPageSize = val;
            this.abnormalPageCurrent = 1;
            this.inspectionReportData(
                this.diagnosis.pathologyId,
                this.abnormalPageCurrent,
                this.abnormalPageSize,
                this.abnormalFilter !== ''
                    ? this.abnormalFilter
                    : this.AbnormalIndicatorFilter,
                this.tabStatusNumber
            );
        },
        changeShowMain() {
            this.ifShowMain = !this.ifShowMain;
            this.$emit('showMain', this.ifShowMain);
        },
        // 胃镜数据
        async getGastroscopyData() {
            // this.inspectionloading = true;
            // try {
            //     const url = `/PROXY-Remote/path-ai-research/gastroscope/patientid?page=1&patientId=${this.diagnosis.pathologyId}&size=1000`;
            //     console.log('get-gastroscopyData', url);
            //     await this.$axios({
            //         // 详见 axios 请求配置项
            //         method: 'GET',
            //         url,
            //     }).then((res) => {
            //         // 请求失败
            //         if (res.data.code !== 200) {
            //             throw new Error(res.data);
            //         }
            //         const { data } = res.data;
            //         for (let i = 0; i < data.length; i++) {
            //             this.gastroscopEeditableTabs.push({
            //                 title: moment(data[i].gastroScope.examTime).format(
            //                     'YYYY/MM/DD'
            //                 ),
            //                 name: `${i}`,
            //                 content: {
            //                     examRecord: data[i].gastroScope.examRecord,
            //                     examFind: data[i].gastroScope.examFind,
            //                     examDocName: data[i].gastroScope.examDocName,
            //                 },
            //             });
            //         }
            //         if (this.gastroscopEeditableTabs.length > 0) {
            //             this.gastroscopeTabsValue =
            //                 this.gastroscopEeditableTabs[0].name;
            //         }
            //     });
            //     this.inspectionloading = false;
            // } catch (e) {
            //     // 跳出
            // }
        },
    },
};
</script>

<style scoped>
</style>
